<?php

/** @var \Laravel\Lumen\Routing\Router $router */


/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
//Front Api-通用型配置


$router->group([
    'prefix'		=> 'api',
    'middleware' => ['api']
], function ($router) {
    //微信回调接口，不需要验证登录
        $router->get('{apiv:[vV][0-9]+}/{module:[a-zA-Z]+}/{ctl:[a-zA-Z]+}/{action:[a-z][A-Za-z0-9]*}', 'Controller@Api');
        $router->post('{apiv:[vV][0-9]+}/{module:[a-zA-Z]+}/{ctl:[a-zA-Z]+}/{action:[a-z][A-Za-z0-9]*}', 'Controller@Api');
});

//登陆接口
$router->group([
    'prefix'		=> 'api',
    'namespace'	=> 'api',
], function ($router) {
  $router->post('login/login', 'LoginController@login');
  $router->post('login/authenticate', 'LoginController@authenticate');

  $router->get('login/login', 'LoginController@login');
  $router->get('login/authenticate', 'LoginController@authenticate');
});
